/**
  ******************************************************************************
  * File Name          : utctime.h
  * Description        : Code for work applications
  ******************************************************************************
  * 
  *
  ******************************************************************************
  */
#ifndef __UTCTIME__
#define __UTCTIME__



/* USER CODE BEGIN Includes */   
/* Includes ------------------------------------------------------------------*/

#include "alldefine.h"


/* USER CODE BEGIN define */





/* USER CODE END define */


/* USER CODE BEGIN FunctionPrototypes */


typedef struct
{
	uint16_t onHours;
	uint16_t onMinutes;
	
	uint16_t offHours;
	uint16_t offMinutes;
}sSetTimeDef;


typedef struct
{
	uint8_t Hours;            /*!< Specifies the RTC Time Hour.
                                 This parameter must be a number between Min_Data = 0 and Max_Data = 23 */

  uint8_t Minutes;          /*!< Specifies the RTC Time Minutes.
                                 This parameter must be a number between Min_Data = 0 and Max_Data = 59 */
  
  uint8_t Seconds;          /*!< Specifies the RTC Time Seconds.
                                 This parameter must be a number between Min_Data = 0 and Max_Data = 59 */
  
  uint8_t WeekDay;  /*!< Specifies the RTC Date WeekDay (not necessary for HAL_RTC_SetDate).
                         This parameter can be a value of @ref RTC_WeekDay_Definitions */
  
  uint8_t Month;    /*!< Specifies the RTC Date Month (in BCD format).
                         This parameter can be a value of @ref RTC_Month_Date_Definitions */

  uint8_t Date;     /*!< Specifies the RTC Date.
                         This parameter must be a number between Min_Data = 1 and Max_Data = 31 */
  
  uint16_t Year;     /*!< Specifies the RTC Date Year.
                         This parameter must be a number between Min_Data = 0 and Max_Data = 99 */


}DateTimeDef;


/* USER CODE END FunctionPrototypes */



/* USER CODE BEGIN Application */



extern 		uint8_t				tTimeSart;
extern		volatile	uint32_t			SysTimeUnix;
extern 		volatile 	uint32_t			SysRunTimeSec;





extern 		uint32_t TimeToUnix(uint16_t Hours,uint16_t Minutes);

extern 		void UnixToDateTime(uint32_t unix,DateTimeDef *sDateTime);

extern 		uint32_t DateTimeToUnix(DateTimeDef *sDateTime);

/* USER CODE END Application */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

#endif

